var common = {
	// 属性 
	version: 1,
	a: '1234',
	// 方法
	test: function() {
		console.info(common.version);
	},
	close: function() {
		$('.close').click(function() {
			$('#DelWarning').hide();
		});
	},
	search: function(e) {
		var a = false;
		$('#search-input').hide();
		$('.search-icon').click(function() {
			a = false;
			stopEvent(event);
			$('#search-input').show().focus();
			$('#search-submit').css({
				"display": "block"
			});
			$('.header-search').addClass("active-search");
		});
		$('#search-input').blur(function() {
			$('body').click(function() {
				a = true;
				if(a) {
					a = false;
					$('#search-input').hide();
					$('#search-submit').css({
						"display": "none"
					});
					$('.header-search').removeClass("active-search");
				}
			});
			$('#search-submit').click(function() {
				a = false;
				stopEvent(event);
			});
			$('#search-input').click(function() {
				a = false;
				stopEvent(event);
			});
		});

		function stopEvent(event) { //阻止冒泡事件
			//取消事件冒泡
			//若省略此句，下面的e改为event，IE运行可以，但是其他浏览器就不兼容
			//grunt 会报错。。
			//var e = arguments.callee.caller.arguments[0] || event;
			
			if(event && event.stopPropagation) {
				// this code is for Mozilla and Opera
				event.stopPropagation();
			} else if(window.event) {
				// this code is for IE
				window.event.cancelBubble = true;
			}
		}
	}, 
	bar: function() {
		$(window).resize(function() {
			if($(window).width() >= 1024) {
				$('#toggle-icon .fa-bars').hide();
				$('#toggle-icon .fa-times').show();
				$('.nav-list').show();
			} else {
				$('#toggle-icon .fa-times').hide();
				$('#toggle-icon .fa-bars').show();
				$('.nav-list').hide();
			}
		});
		$('#toggle-icon .fa-bars').click(function() {
			$('#toggle-icon .fa-bars').hide();
			$('#toggle-icon .fa-times').show();
			$('.nav-list').slideDown(300);
			$('.home-prev').hide();
		});
		$('#toggle-icon .fa-times').click(function() {
			$('#toggle-icon .fa-times').hide();
			$('#toggle-icon .fa-bars').show();
			$('.nav-list').slideUp(300);
			$('.home-prev').show();
		});

	}
};